#ifndef _STATELOADER_H_
#define _STATELOADER_H_

#include <memory>
#include <sol/state.hpp>
#include <functional>
#include <vector>

namespace SEngine
{
    class StateLoader
    {
    public:
        virtual ~StateLoader() = default;
        static StateLoader & GetInstance();
        std::unique_ptr<sol::state> CreateState();
        void Register(std::function<void(sol::state&)> && fn) { m_registerTable.emplace_back(fn); }
    private:
        StateLoader();

    private:
        std::vector<std::function<void(sol::state&)>> m_registerTable;
    };
} // namespace SEngine


#endif